package state.state.impl;

import state.OrderContext;
import state.state.OrderState;

/**
 * 具体状态 (Concrete States):待付款状态
 *
 * @author Liu Yicong
 * @date 2025/9/25
 */
public class PendingPaymentState implements OrderState {
	@Override
	public void processOrder(OrderContext context) {
		System.out.println("订单已付款，状态从 [待付款] 转换为 [已发货]");
		// 状态转换：由具体状态类负责改变上下文的状态
		context.setState(new ShippedState());
	}

	@Override
	public void cancelOrder(OrderContext context) {
		System.out.println("订单在待付款状态下被取消。");
		context.setState(new CancelledState());
	}

}
